export default {
  state:{
    name : '张三'
  },
  mutations:{
    updatename(state,upload){
      state.name = upload
    }
  },
  actions:{
    aUpdateName(context){
      //只commit 自己的mutations
      setTimeout(() => {
        context.commit('updatename','wangwu')
      },1000)

    }
  },
  getters:{
    fullName(state){
      return state.name + '1111'
    },
    fullName2(state,getters){
      return getters.fullName + '2222'
    },
    fullName3(state,getters,rootState){
      return getters.fullName2 + rootState.counter
    },
  },
}
